Set<TData>(DicomScp,TData,BeforeAddTagDelegate) Method

Summary
Sends an N-SET-REQ to the SCP.
Syntax
C#
C++/CLI
public void Set<TData>( 
   DicomScp Scp, 
   TData Data, 
   BeforeAddTagDelegate beforeAdd 
) 
public: 
void Setgeneric<typename TData> 
(  
   DicomScp^ Scp, 
   _TData^_ Data, 
   BeforeAddTagDelegate^ beforeAdd 
)  

Parameters

Scp
The peer connection to send the N-SET-REQ to.

Data
The data to send in the N-SET-REQ.

beforeAdd
The delegate to call before adding Data properties to the dataset that will be used in the N-SET-REQ.

Type Parameters

TData
The type of the data.

Example
C#
using Leadtools.Dicom.Common.DataTypes.Modality; 
using Leadtools.Dicom; 
using Leadtools.Dicom.Scu.Queries; 
using Leadtools.Dicom.Scu; 
using Leadtools.Dicom.Common.Extensions; 
using Leadtools.Dicom.Scu.Common; 
 
 
 
List<ModalityWorklistResult> WorkList = new List<ModalityWorklistResult>(); 
 
public void BeforeTagTest() 
{ 
   DicomEngine.Startup(); 
   DicomNet.Startup(); 
 
   ModalityWorklistQuery query = new ModalityWorklistQuery(); 
   DicomScp scp = new DicomScp(); 
   QueryRetrieveScu findMwl = new QueryRetrieveScu(); 
 
   scp.AETitle = "MWL_SERVER"; 
   scp.Port = 104; 
   scp.Timeout = 60; 
   scp.PeerAddress = IPAddress.Parse("192.168.0.209"); 
   findMwl.AETitle = "LEAD_CLIENT"; 
   findMwl.Find<ModalityWorklistQuery, ModalityWorklistResult>(scp, query, NewWorklist); 
 
   // 
   // Create a Modality Perform Procedure Step 
   if (WorkList.Count > 0) 
   { 
      ModalityPerformedProcedureStep mpps = ModalityPerformedProcedureStep.From(WorkList[0]); 
      PerformedProcedureStepScu pps = new PerformedProcedureStepScu(); 
 
      pps.AETitle = "LEAD_CLIENT"; 
 
      // 
      // Initialize required procedure step variables 
      // 
      mpps.PerformedStationAeTitle = Environment.MachineName; 
      mpps.PerformedProcedureStepStartDate = DateTime.Now; 
      mpps.PerformedProcedureStepStartTime = DateTime.Now; 
      mpps.PerformedSeriesSequence[0].ProtocolName = ModalityPerformedProcedureStep.RandomId(16); 
      mpps.PerformedSeriesSequence[0].SeriesInstanceUID = "1.2.3.4.5.890.1232"; 
      mpps.SOPInstance.SOPInstanceUid = "1.2.3.4.5.890.1240.1" + DateTime.Now.Ticks.ToString(); 
 
      try 
      { 
         pps.Create<ModalityPerformedProcedureStep>(scp, mpps, new BeforeAddTagDelegate(BeforeAddTagDelegate)); 
 
         // 
         // Set the procedure step to done 
         // 
         mpps.PerformedProcedureStepEndDate = DateTime.Now; 
         mpps.PerformedProcedureStepEndTime = DateTime.Now; 
         mpps.PerformedProcedureStepStatus = "COMPLETED"; 
         pps.Set<ModalityPerformedProcedureStep>(scp, mpps, new BeforeAddTagDelegate(BeforeAddTagDelegate)); 
      } 
      catch (Exception e) 
      { 
         Console.WriteLine(e.Message); 
      } 
   } 
 
   DicomEngine.Shutdown(); 
   DicomNet.Startup(); 
} 
 
private void NewWorklist(ModalityWorklistResult result, DicomDataSet ds) 
{ 
   WorkList.Add(result); 
} 
 
private bool BeforeAddTagDelegate(LinkedList<long> parent, object data, long tag) 
{ 
   DicomTag dcmTag = DicomTagTable.Instance.Find(tag); 
 
   if (dcmTag != null) 
   { 
      Console.WriteLine("Tag: " + dcmTag.Name); 
   } 
   else 
      Console.WriteLine(string.Format("Tag: {0:x4}:{1:x4}", DicomExtensions.GetGroup(tag), DicomExtensions.GetElement(tag))); 
 
   return true; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.1.24
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Scu Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.